package com.hdu.point_offer;

public class lcr173 {
    class Solution {
        public int takeAttendance(int[] records) {
            int l = 0, r = records.length - 1, ans = -1;
            while (l < r)
            {
                int mid = (l + r) >> 1;
                if (records[mid] != mid)
                {
                    ans = mid;
                    r = mid - 1;
                }
                else
                {
                    l = mid + 1;
                }
            }
            return ans;
        }
    }
}
